﻿using Microsoft.AspNetCore.Mvc;
using System.Text;

namespace PageOffice6_Net_Core.Controllers.SwitchFile
{
    public class SwitchFileController : Controller
    {
        public IActionResult Index()
        {
            return View();
        }

        public void Word(string fileName)
        {
            PageOfficeNetCore.PageOfficeCtrl poCtrl = new PageOfficeNetCore.PageOfficeCtrl(Request);
            //打开Word文档
            poCtrl.WebOpen("doc/"+fileName, PageOfficeNetCore.OpenModeType.docRevisionOnly, "tom");
           
            Response.Body.WriteAsync(Encoding.GetEncoding("GB2312").GetBytes(poCtrl.GetHtml()));
            
        }
    }
}